:root {
    --primary: #5d4037;
    --primary-light: #8d6e63;
    --secondary: #4e342e;
    --accent: #d7ccc8;
    --light: #efebe9;
    --dark: #3e2723;
    --text: #4e342e;
    --success: #2e7d32;
    --internet: #5e35b1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
    padding: 15px;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 36px;
    color: var(--primary);
    animation: pulse 2s infinite;
}

h1 {
    font-size: 36px;
    background: linear-gradient(to right, var(--primary), var(--dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 15px;
    color: var(--primary-light);
    max-width: 600px;
    margin: 0 auto 20px;
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .generator-container {
        grid-template-columns: 1fr;
    }
}

.control-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.result-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
     /* 新增以下样式 */
    max-height: 600px; /* 设置最大高度，可根据需要调整 */
    min-height: 400px; /* 设置最小高度，确保面板不会过小 */
}
.results-container {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
    margin-bottom: 20px;
    /* 新增以下样式 */
    overflow-y: auto; /* 允许垂直滚动 */
    padding-right: 8px; /* 预留滚动条空间，避免内容被遮挡 */
    padding: 10px; /* 增加容器内边距，让边缘卡片也有足够空间 */
}

/* 美化滚动条（可选） */
.results-container::-webkit-scrollbar {
    width: 6px;
}

.results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.results-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.panel-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 15px;
    color: var(--dark);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-light);
    pointer-events: none;
    font-size: 14px;
}

select {
    width: 100%;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: white;
    font-size: 14px;
    color: var(--text);
    appearance: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(93, 64, 55, 0.1);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 12px;
    background: var(--light);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.checkbox-label:hover {
    background: #e8e0dd;
}

input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="range"] {
    flex-grow: 1;
    height: 5px;
    appearance: none;
    background: #e0e0e0;
    border-radius: 8px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--dark);
}

.number-display {
    min-width: 36px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--dark));
    color: white;
    box-shadow: 0 4px 12px rgba(93, 64, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(93, 64, 55, 0.4);
}

.btn-internet {
    background: linear-gradient(to right, var(--internet), #4527a0);
    color: white;
    box-shadow: 0 4px 12px rgba(94, 53, 177, 0.3);
}

.btn-internet:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(94, 53, 177, 0.4);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #e8e0dd;
}

.results-container {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.name-card {
    background: var(--light);
    border-radius: 10px;
    padding: 20px 16px; /* 增加内边距，让内容不那么拥挤 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
     min-height: 100px; /* 确保卡片有足够高度，保持一致性 */
}

.name-card.internet {
    background: linear-gradient(135deg, #f3f0ff 0%, #e8e2ff 100%);
    border: 1px solid rgba(94, 53, 177, 0.1);
}

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.name-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
}

.name-card.internet::before {
    background: var(--internet);
}

.name {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--dark);
}

.name-card.internet .name {
    color: var(--internet);
}

.origin {
    font-size: 12px;
    color: var(--primary-light);
    font-style: italic;
}

.name-card.internet .origin {
    color: #7e57c2;
}

.gender {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.1);
}

.male {
    color: #1976d2;
}

.female {
    color: #c2185b;
}

.internet-tag {
    background: rgba(94, 53, 177, 0.1);
    color: var(--internet);
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px;
}

.result-count {
    font-size: 14px;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-btn {
    padding: 8px 16px;
    background: var(--light);
    border-radius: 6px;
    border: none;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.export-btn:hover {
    background: #e8e0dd;
}

.favorite-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #bdbdbd;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.favorite-btn.active {
    color: #f44336;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    color: var(--primary-light);
}

.empty-state i {
    font-size: 50px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 15px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.name-card {
    animation: fadeIn 0.5s ease forwards;
}

/* 名字详情面板样式 */
.name-details {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.details-title {
    margin-top: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.details-content {
    padding: 15px 0;
    min-height: 80px;
}

.name-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.detail-name {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.detail-metadata {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: #666;
}

.detail-meaning {
    line-height: 1.6;
    color: #444;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.empty-details {
    text-align: center;
    padding: 20px;
    color: #888;
}

.empty-details i {
    font-size: 24px;
    margin-bottom: 10px;
    opacity: 0.5;
}

footer {
    text-align: center;
    padding: 16px;
    color: var(--primary-light);
    font-size: 12px;
    margin-top: 16px;
}

.featured-names {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.featured-name {
    padding: 6px 12px;
    background: rgba(93, 64, 55, 0.1);
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.featured-name:hover {
    background: rgba(93, 64, 55, 0.2);
}

.highlight {
    background: linear-gradient(120deg, rgba(93, 64, 55, 0.1), rgba(93, 64, 55, 0.05));
    background-repeat: no-repeat;
    background-size: 100% 40%;
    background-position: 0 88%;
}

.type-selector {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--light);
}

.type-option {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.type-option.active {
    background: var(--primary);
    color: white;
}

.type-option.internet.active {
    background: var(--internet);
}